//
//  SKRootCell.m
//  SouthKoreaDoorLock
//
//  Created by Umeinfo on 2018/1/17.
//  Copyright © 2018年 andy90s. All rights reserved.
//

#import "SKRootCell.h"

@implementation SKRootCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupViews];
    }
    return self;
}

- (void)setFrame:(CGRect)frame {
    frame.origin.x += 10;
    frame.origin.y += 10;
    frame.size.height -= 10;
    frame.size.width -= 20;
    [super setFrame:frame];
}

- (void)setupViews {
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.backgroundColor = [UIColor clearColor];
    self.contentView.layer.cornerRadius = 10;
    self.contentView.backgroundColor = [UIColor colorWithRed:0.53 green:0.47 blue:0.38 alpha:1.00];
    [self.contentView addSubview:self.icon];
    [self.contentView addSubview:self.titleLab];
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.offset(35);
        make.centerY.equalTo(self);
    }];
    
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        
    }];
}

#pragma mark - lazy

- (UIImageView *)icon {
    if (!_icon) {
        _icon = [UIImageView new];
        _icon.image = [UIImage imageNamed:@"signin_pw"];
    }
    return _icon;
}

- (UILabel *)titleLab {
    if (!_titleLab) {
        _titleLab = [UILabel new];
        _titleLab.textColor = [UIColor whiteColor];
    }
    return _titleLab;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
